﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlTypes;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WF_PrimeNum
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            label3.Text = string.Empty;
            bool isNum1=int.TryParse(textBox1.Text,out Program.max), isNum2=int.TryParse(textBox2.Text,out Program.min);
            if(isNum1&&isNum2&&Program.min>=2&&Program.max>=Program.min)
            {
                label3.Text = "处理结果如下："+Environment.NewLine+Program.getPrime(Program.max,Program.min);
            }
            else
            {
                label3.Text = "不合法的输入。";
            }
           
        }
    }
}
